﻿#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    partial class Strategy
    {
        ///Returns the second highest value of the listed inputs. See MaxList for syntax.
        public double MaxList2(double[] list)
        {
            double max1 = 0, max2 = 0;
            foreach (double number in list)
                if (number > max2)
                {
                    if (number > max1)
                    {
                        max2 = max1;
                        max1 = number;
                    }
                    else
                        max2 = number;
                }
            return max2;
        }

    }
}
